/**
*@Author 周贞荣
*@Modify 周贞荣
*@Date 2022/3/24 16:09
*@Description 文件功能描述
*/
<template>
    <van-address-edit
            :area-list="areaList"
            show-postal
            show-delete
            show-set-default
            show-search-result
            :search-result="searchResult"
            :area-columns-placeholder="['请选择', '请选择', '请选择']"
            @save="onSave"
            @delete="onDelete"
            @change-detail="onChangeDetail"
    />
</template>

<script lang="ts" setup>
    import {ref, reactive, watch, getCurrentInstance} from "vue";

    const {proxy} = getCurrentInstance();
    const searchResult = ref([]);

    const onSave = () => proxy.$router.back();
    const onDelete = () => proxy.$router.back();
    const onChangeDetail = (val) => {
        if (val) {
            searchResult.value = [
                {
                    name: '黄龙万科中心',
                    address: '杭州市西湖区',
                },
            ];
        } else {
            searchResult.value = [];
        }
    };
</script>

<style scoped>

</style>